package jwebtester.dal.entities;

// Generated Oct 31, 2012 3:54:40 PM by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * OrganizationEntity generated by hbm2java
 */
@Entity
@Table(name = "ORGANIZATION", schema = "PUBLIC", catalog = "PUBLIC", uniqueConstraints = @UniqueConstraint(columnNames = "NAME"))
public class OrganizationEntity implements java.io.Serializable {

	private Integer id;
	private String name;
	private Set<ExpertGroupEntity> expertGroupEntities = new HashSet<ExpertGroupEntity>(0);
	private Set<CompetencyEntity> competencyEntities = new HashSet<CompetencyEntity>(0);
	private Set<CompetencyModelEntity> competencyModelEntities = new HashSet<CompetencyModelEntity>(
			0);
	private Set<UserEntity> userEntities = new HashSet<UserEntity>(0);

	public OrganizationEntity() {
	}

	public OrganizationEntity(String name) {
		this.name = name;
	}

	public OrganizationEntity(String name, Set<ExpertGroupEntity> expertGroupEntities,
			Set<CompetencyEntity> competencyEntities,
			Set<CompetencyModelEntity> competencyModelEntities, Set<UserEntity> userEntities) {
		this.name = name;
		this.expertGroupEntities = expertGroupEntities;
		this.competencyEntities = competencyEntities;
		this.competencyModelEntities = competencyModelEntities;
		this.userEntities = userEntities;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "NAME", unique = true, nullable = false, length = 72)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "organizationEntity")
	public Set<ExpertGroupEntity> getExpertGroupEntities() {
		return this.expertGroupEntities;
	}

	public void setExpertGroupEntities(Set<ExpertGroupEntity> expertGroupEntities) {
		this.expertGroupEntities = expertGroupEntities;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "organizationEntity")
	public Set<CompetencyEntity> getCompetencyEntities() {
		return this.competencyEntities;
	}

	public void setCompetencyEntities(Set<CompetencyEntity> competencyEntities) {
		this.competencyEntities = competencyEntities;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "organizationEntity")
	public Set<CompetencyModelEntity> getCompetencyModelEntities() {
		return this.competencyModelEntities;
	}

	public void setCompetencyModelEntities(Set<CompetencyModelEntity> competencyModelEntities) {
		this.competencyModelEntities = competencyModelEntities;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "organizationEntity")
	public Set<UserEntity> getUserEntities() {
		return this.userEntities;
	}

	public void setUserEntities(Set<UserEntity> userEntities) {
		this.userEntities = userEntities;
	}

}
